<?php
/*******************************************************************************
 * $Date:: Sep 29, 2011 10:45:36 AM                                            $
 * $Revision:                                                                  $
 * $Author:: Tuan Duong                                                        $
 * $Comment::                                                                  $
 ******************************************************************************/ 
/**
 * User controller for front-end
 * 
 * @package Lua
 * @subpackage Controller
 * @author Hung LE <hunglevn[at]gmail[dot]com>
 * @version 
 */

class DetailUserController extends Lua_Controller_Default
{
	private $locationService;
	private $userService;
    private $friendService;
    	
	public function __construct() {
		parent::__construct();
		$this->locationService = Lua_Service_Locator::getInstance()->getService("Location");
		$this->userService = Lua_Service_Locator::getInstance()->getService("User");
		$this->friendService = Lua_Service_Locator::getInstance()->getService("Friend");
		
	}
	
    /**
     * Index Action
     */
    public function indexAction() {
        $auth = Zend_Auth::getInstance();
        if ($auth->hasIdentity()) {
    		$identity = $auth->getIdentity();
            $userId = $identity->id;
    		$loginUser = $this->userService->findUserByProperty("id", $userId);
            $loginUser = $loginUser[0];
            $loginUser['econtact'] = $this->userService->parseEcontactToArray($loginUser['econtact']);
            var_dump($loginUser['econtact']);
            $this->view->assign('loginUser', $loginUser);
        }
    }
}